/**
 * Created by edik on 2017/3/25.
 */
$.get('/ajax/index', function (d) {
    new Vue({
        el: '#app',
        data: {
            top: d.items[0].data.data,
            hot: d.items[1].data.data,
            recommend: d.items[2].data.data,
            female: d.items[3].data.data,
            male: d.items[4].data.data,
            free: d.items[5].data.data,
            topic: d.items[6].data.data,
            duration:0,
            position:0,
            header_position:0,
            header_duration:0,
            isActive: true
        },
        methods: {
            tabSwitch: function(pos){
                this.isActive = !this.isActive;
                this.duration = 0.5;
                this.header_duration = 0.5;
                if(pos == 0){
                    this.position = 0;
                    this.header_position = 0;
                }else{
                    this.position = (-50);
                    this.header_position = 100;
                }
            }
        }
    })
}, 'json');